/* pages/chat/chat.wxss */
/* 基础样式 */
page {
  background-color: #EDEDED;
  height: 100vh;
  font-size: 16px;
}

.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  // padding-bottom: env(safe-area-inset-bottom);
}

/* 消息列表 */
.message-list {
  flex: 1;
  overflow-anchor: none;
}

/* 消息项 */
.message-item {
  display: flex;
  margin-bottom: 16px;
}

.message-item.user {
  flex-direction: row-reverse;
}

/* 头像 */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  margin: 0 6px;
}

/* 气泡 */
.bubble {
  position: relative;
  max-width: 63%;
  padding: 10px 14px;
  border-radius: 5px;
  line-height: 1.5;
  word-break: break-word;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.user .bubble {
  background-color: #95EC69;
  margin-left: 50px;
  border-top-right-radius: 0;
}

.assistant .bubble {
  background-color: #FFFFFF;
  margin-right: 20px;
  border-top-left-radius: 0;
}

/* 输入区域 */
.input-area {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  background-color: #F7F7F7;
  border-top: 1px solid #E5E5E5;
}

.input-box {
  flex: 1;
  background-color: #FFFFFF;
  border-radius: 5px;
  padding: 8rpx 12rpx;
  font-size: 16px;
  margin-right: 10px;
  min-height: 36px;
  max-height: 80px;
}

.placeholder {
  color: #999999;
}

.send-btn {
  background-color: #07C160;
  color: white;
  border-radius: 5px;
  padding: 0 10px;
  height: 36px;
  font-weight: normal;
  width: 100px !important;
  line-height: 36px;
  font-size: 16px;
  margin: 0;
}

.send-btn:disabled {
  background-color: #B2B2B2;
  opacity: 0.6;
}

/* iPhone X适配 */
@media only screen and (device-width: 375px) and (device-height: 812px) {
  .chat-container {
    // padding-bottom: 14px !important;
  }
}


/* 打字机效果 */
.assistant-message {
  line-height: 1.6;
  white-space: pre-wrap;
}

/* 光标动画 */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.cursor::after {
  content: '▌';
  animation: blink 1s step-end infinite;
}
